package com.groupten.Dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.groupten.Entity.ClassPaperEntity;
import com.groupten.Vo.ClassVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ClassPaperDao extends BaseMapper<ClassPaperEntity> {

    @Update("update `class_paper` set average_score = #{averageScore} , standard_deviation = #{standardDeviation} ,passing_rate = #{passingRate} , excellent_rate = #{excellentRate} , attend_number = #{attendNumber} where paper_session = #{paperSession} and classname = #{classname}  ")
    int updateData(ClassPaperEntity classPaperEntity);

    @Select("select * from class_paper where classname = #{className} and paper_session = #{paperSession} ")
    ClassPaperEntity selectByClassAndSession(String className,Integer paperSession);

    @Select("select score from student_paper where class_number = #{classNumber} and paper_session = #{paperSession} ")
    List<Double> selectScoreByClassAndSession(String classNumber,Integer paperSession);

}
